package com.order.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.order.app.mapper.ProductOrderMapper;
import com.order.app.service.OrderService;
import com.tamll.bean.ProductOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private ProductOrderMapper productOrderMapper;

    @Override
    public Page<ProductOrder> OrderMessage(Integer pageNumber, Integer num) {
        Page<ProductOrder> productOrderPage=new Page<>(pageNumber,num);
        QueryWrapper<ProductOrder> wrapper=new QueryWrapper<>();
        Page<ProductOrder> productOrderPage1 = productOrderMapper.selectPage(productOrderPage, wrapper);
        System.out.println(productOrderPage1.getTotal());
        System.out.println("总页数:"+productOrderPage1.getPages());
        System.out.println("总记录数:"+productOrderPage1.getTotal());
        return productOrderPage1;
    }
}
